Optimal. Leaf size=87 \[ -\frac {(d+e x)^2}{a+b x+c x^2}-\frac {2 e (2 c d-b e) \tanh ^{-1}\left (\frac {b+2 c x}{\sqrt {b^2-4 a c}}\right )}{c \sqrt {b^2-4 a c}}+\frac {e^2 \log \left (a+b x+c x^2\right )}{c} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.04, antiderivative size = 87, normalized size of antiderivative = 1.00, number of steps
used = 5, number of rules used = 5, integrand size = 26, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.192, Rules used = {782, 648, 632,
212, 642} \begin {gather*} -\frac {2 e (2 c d-b e) \tanh ^{-1}\left (\frac {b+2 c x}{\sqrt {b^2-4 a c}}\right )}{c \sqrt {b^2-4 a c}}-\frac {(d+e x)^2}{a+b x+c x^2}+\frac {e^2 \log \left (a+b x+c x^2\right )}{c} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 212
Rule 632
Rule 642
Rule 648
Rule 782
Rubi steps
\begin {align*} \int \frac {(b+2 c x) (d+e x)^2}{\left (a+b x+c x^2\right )^2} \, dx &=-\frac {(d+e x)^2}{a+b x+c x^2}+(2 e) \int \frac {d+e x}{a+b x+c x^2} \, dx\\ &=-\frac {(d+e x)^2}{a+b x+c x^2}+\frac {e^2 \int \frac {b+2 c x}{a+b x+c x^2} \, dx}{c}+\frac {(e (2 c d-b e)) \int \frac {1}{a+b x+c x^2} \, dx}{c}\\ &=-\frac {(d+e x)^2}{a+b x+c x^2}+\frac {e^2 \log \left (a+b x+c x^2\right )}{c}-\frac {(2 e (2 c d-b e)) \text {Subst}\left (\int \frac {1}{b^2-4 a c-x^2} \, dx,x,b+2 c x\right )}{c}\\ &=-\frac {(d+e x)^2}{a+b x+c x^2}-\frac {2 e (2 c d-b e) \tanh ^{-1}\left (\frac {b+2 c x}{\sqrt {b^2-4 a c}}\right )}{c \sqrt {b^2-4 a c}}+\frac {e^2 \log \left (a+b x+c x^2\right )}{c}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.08, size = 98, normalized size = 1.13 \begin {gather*} \frac {\frac {e^2 (a+b x)-c d (d+2 e x)}{a+x (b+c x)}-\frac {2 e (-2 c d+b e) \tan ^{-1}\left (\frac {b+2 c x}{\sqrt {-b^2+4 a c}}\right )}{\sqrt {-b^2+4 a c}}+e^2 \log (a+x (b+c x))}{c} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.96, size = 110, normalized size = 1.26
method | result | size |
default | \(\frac {\frac {e \left (b e -2 c d \right ) x}{c}+\frac {e^{2} a -c \,d^{2}}{c}}{c \,x^{2}+b x +a}+2 e \left (\frac {e \ln \left (c \,x^{2}+b x +a \right )}{2 c}+\frac {2 \left (d -\frac {b e}{2 c}\right ) \arctan \left (\frac {2 c x +b}{\sqrt {4 a c -b^{2}}}\right )}{\sqrt {4 a c -b^{2}}}\right )\) | \(110\) |
risch | \(\frac {\frac {e \left (b e -2 c d \right ) x}{c}+\frac {e^{2} a -c \,d^{2}}{c}}{c \,x^{2}+b x +a}+\frac {4 e^{2} \ln \left (-4 a b c e +8 a \,c^{2} d +e \,b^{3}-2 b^{2} c d -2 \sqrt {-\left (b e -2 c d \right )^{2} \left (4 a c -b^{2}\right )}\, c x -\sqrt {-\left (b e -2 c d \right )^{2} \left (4 a c -b^{2}\right )}\, b \right ) a}{4 a c -b^{2}}-\frac {e^{2} \ln \left (-4 a b c e +8 a \,c^{2} d +e \,b^{3}-2 b^{2} c d -2 \sqrt {-\left (b e -2 c d \right )^{2} \left (4 a c -b^{2}\right )}\, c x -\sqrt {-\left (b e -2 c d \right )^{2} \left (4 a c -b^{2}\right )}\, b \right ) b^{2}}{c \left (4 a c -b^{2}\right )}+\frac {e \ln \left (-4 a b c e +8 a \,c^{2} d +e \,b^{3}-2 b^{2} c d -2 \sqrt {-\left (b e -2 c d \right )^{2} \left (4 a c -b^{2}\right )}\, c x -\sqrt {-\left (b e -2 c d \right )^{2} \left (4 a c -b^{2}\right )}\, b \right ) \sqrt {-\left (b e -2 c d \right )^{2} \left (4 a c -b^{2}\right )}}{c \left (4 a c -b^{2}\right )}+\frac {4 e^{2} \ln \left (-4 a b c e +8 a \,c^{2} d +e \,b^{3}-2 b^{2} c d +2 \sqrt {-\left (b e -2 c d \right )^{2} \left (4 a c -b^{2}\right )}\, c x +\sqrt {-\left (b e -2 c d \right )^{2} \left (4 a c -b^{2}\right )}\, b \right ) a}{4 a c -b^{2}}-\frac {e^{2} \ln \left (-4 a b c e +8 a \,c^{2} d +e \,b^{3}-2 b^{2} c d +2 \sqrt {-\left (b e -2 c d \right )^{2} \left (4 a c -b^{2}\right )}\, c x +\sqrt {-\left (b e -2 c d \right )^{2} \left (4 a c -b^{2}\right )}\, b \right ) b^{2}}{c \left (4 a c -b^{2}\right )}-\frac {e \ln \left (-4 a b c e +8 a \,c^{2} d +e \,b^{3}-2 b^{2} c d +2 \sqrt {-\left (b e -2 c d \right )^{2} \left (4 a c -b^{2}\right )}\, c x +\sqrt {-\left (b e -2 c d \right )^{2} \left (4 a c -b^{2}\right )}\, b \right ) \sqrt {-\left (b e -2 c d \right )^{2} \left (4 a c -b^{2}\right )}}{c \left (4 a c -b^{2}\right )}\) | \(700\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: ValueError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 254 vs.
\(2 (85) = 170\).
time = 2.25, size = 528, normalized size = 6.07 \begin {gather*} \left [-\frac {2 \, {\left (b^{2} c - 4 \, a c^{2}\right )} d x e + {\left (b^{2} c - 4 \, a c^{2}\right )} d^{2} - {\left (a b^{2} - 4 \, a^{2} c + {\left (b^{2} c - 4 \, a c^{2}\right )} x^{2} + {\left (b^{3} - 4 \, a b c\right )} x\right )} e^{2} \log \left (c x^{2} + b x + a\right ) - \sqrt {b^{2} - 4 \, a c} {\left ({\left (b c x^{2} + b^{2} x + a b\right )} e^{2} - 2 \, {\left (c^{2} d x^{2} + b c d x + a c d\right )} e\right )} \log \left (\frac {2 \, c^{2} x^{2} + 2 \, b c x + b^{2} - 2 \, a c + \sqrt {b^{2} - 4 \, a c} {\left (2 \, c x + b\right )}}{c x^{2} + b x + a}\right ) - {\left (a b^{2} - 4 \, a^{2} c + {\left (b^{3} - 4 \, a b c\right )} x\right )} e^{2}}{a b^{2} c - 4 \, a^{2} c^{2} + {\left (b^{2} c^{2} - 4 \, a c^{3}\right )} x^{2} + {\left (b^{3} c - 4 \, a b c^{2}\right )} x}, -\frac {2 \, {\left (b^{2} c - 4 \, a c^{2}\right )} d x e + {\left (b^{2} c - 4 \, a c^{2}\right )} d^{2} - {\left (a b^{2} - 4 \, a^{2} c + {\left (b^{2} c - 4 \, a c^{2}\right )} x^{2} + {\left (b^{3} - 4 \, a b c\right )} x\right )} e^{2} \log \left (c x^{2} + b x + a\right ) - 2 \, \sqrt {-b^{2} + 4 \, a c} {\left ({\left (b c x^{2} + b^{2} x + a b\right )} e^{2} - 2 \, {\left (c^{2} d x^{2} + b c d x + a c d\right )} e\right )} \arctan \left (-\frac {\sqrt {-b^{2} + 4 \, a c} {\left (2 \, c x + b\right )}}{b^{2} - 4 \, a c}\right ) - {\left (a b^{2} - 4 \, a^{2} c + {\left (b^{3} - 4 \, a b c\right )} x\right )} e^{2}}{a b^{2} c - 4 \, a^{2} c^{2} + {\left (b^{2} c^{2} - 4 \, a c^{3}\right )} x^{2} + {\left (b^{3} c - 4 \, a b c^{2}\right )} x}\right ] \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 340 vs.
\(2 (78) = 156\).
time = 2.10, size = 340, normalized size = 3.91 \begin {gather*} \left (\frac {e^{2}}{c} - \frac {e \sqrt {- 4 a c + b^{2}} \left (b e - 2 c d\right )}{c \left (4 a c - b^{2}\right )}\right ) \log {\left (x + \frac {- 4 a c \left (\frac {e^{2}}{c} - \frac {e \sqrt {- 4 a c + b^{2}} \left (b e - 2 c d\right )}{c \left (4 a c - b^{2}\right )}\right ) + 4 a e^{2} + b^{2} \left (\frac {e^{2}}{c} - \frac {e \sqrt {- 4 a c + b^{2}} \left (b e - 2 c d\right )}{c \left (4 a c - b^{2}\right )}\right ) - 2 b d e}{2 b e^{2} - 4 c d e} \right )} + \left (\frac {e^{2}}{c} + \frac {e \sqrt {- 4 a c + b^{2}} \left (b e - 2 c d\right )}{c \left (4 a c - b^{2}\right )}\right ) \log {\left (x + \frac {- 4 a c \left (\frac {e^{2}}{c} + \frac {e \sqrt {- 4 a c + b^{2}} \left (b e - 2 c d\right )}{c \left (4 a c - b^{2}\right )}\right ) + 4 a e^{2} + b^{2} \left (\frac {e^{2}}{c} + \frac {e \sqrt {- 4 a c + b^{2}} \left (b e - 2 c d\right )}{c \left (4 a c - b^{2}\right )}\right ) - 2 b d e}{2 b e^{2} - 4 c d e} \right )} + \frac {a e^{2} - c d^{2} + x \left (b e^{2} - 2 c d e\right )}{a c + b c x + c^{2} x^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 1.86, size = 114, normalized size = 1.31 \begin {gather*} \frac {e^{2} \log \left (c x^{2} + b x + a\right )}{c} + \frac {2 \, {\left (2 \, c d e - b e^{2}\right )} \arctan \left (\frac {2 \, c x + b}{\sqrt {-b^{2} + 4 \, a c}}\right )}{\sqrt {-b^{2} + 4 \, a c} c} - \frac {\frac {{\left (2 \, c d e - b e^{2}\right )} x}{c} + \frac {c d^{2} - a e^{2}}{c}}{c x^{2} + b x + a} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.18, size = 248, normalized size = 2.85 \begin {gather*} \frac {a\,e^2}{c^2\,x^2+b\,c\,x+a\,c}-\frac {d^2}{c\,x^2+b\,x+a}+\frac {b\,e^2\,x}{c^2\,x^2+b\,c\,x+a\,c}-\frac {2\,d\,e\,x}{c\,x^2+b\,x+a}-\frac {b^2\,e^2\,\ln \left (c\,x^2+b\,x+a\right )}{4\,a\,c^2-b^2\,c}+\frac {4\,d\,e\,\mathrm {atan}\left (\frac {b}{\sqrt {4\,a\,c-b^2}}+\frac {2\,c\,x}{\sqrt {4\,a\,c-b^2}}\right )}{\sqrt {4\,a\,c-b^2}}-\frac {2\,b\,e^2\,\mathrm {atan}\left (\frac {b}{\sqrt {4\,a\,c-b^2}}+\frac {2\,c\,x}{\sqrt {4\,a\,c-b^2}}\right )}{c\,\sqrt {4\,a\,c-b^2}}+\frac {4\,a\,c\,e^2\,\ln \left (c\,x^2+b\,x+a\right )}{4\,a\,c^2-b^2\,c} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________